home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / usr_-_Usr_Files / SBIN / UNLOCK < prev    next >
Text File  |  1999-09-17  |  372b  |  24 lines

  1. #!/bin/sh
  2.  
  3. LOCKDIR=/var/lock
  4.  
  5. case "$1" in
  6.     "")        echo "Usage: unlock lockfile"; exit 1 ;;
  7.     .*)        echo "Usage: unlock lockfile"; exit 1 ;;
  8. esac
  9.  
  10. if [ -f $LOCKDIR/$1 ]
  11. then
  12.     if [ `wc -l < $LOCKDIR/$1` -eq 1 ]
  13.     then
  14.         rm -f $LOCKDIR/$1
  15.         exit 0
  16.     else
  17.         echo "Usage: unlock lockfile"
  18.         exit 1
  19.     fi
  20. else
  21.     echo "lockfile" $LOCKDIR/$1 "does not exist"
  22.     exit 1
  23. fi
  24.